package com.AAL.Model;

import java.io.Serializable;
import javax.persistence.*;

import java.sql.Timestamp;
import java.math.BigDecimal;


/**
 * The persistent class for the OrderInvoices database table.
 * 
 */
@Entity
@Table(name="OrderInvoices")
public class OrderInvoice implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="OrderInvoiceID")
	private String orderInvoiceID;

	@Column(name="Discount")
	private short discount;

	@Column(name="IsWritingExwarehouseVotes")
	private boolean isWritingExwarehouseVotes;

	@Column(name="PreTotalMoney")
	private BigDecimal preTotalMoney;

	@Column(name="Tax")
	private short tax;

	@Column(name="TotalMoney")
	private BigDecimal totalMoney;

	@Column(name="WritingDate")
	private Timestamp writingDate;

	//bi-directional many-to-one association to Order
	@OneToOne(cascade={CascadeType.REFRESH})
	@JoinColumn(name="OrderID")
	private Order order;

	//bi-directional one-to-one association to LogForStock
	@OneToOne(mappedBy="orderInvoice", cascade={CascadeType.REMOVE, CascadeType.REFRESH})
	private LogForStock logForStock;

    public OrderInvoice() {
    }

	public String getOrderInvoiceID() {
		return this.orderInvoiceID;
	}

	public void setOrderInvoiceID(String orderInvoiceID) {
		this.orderInvoiceID = orderInvoiceID;
	}

	public short getDiscount() {
		return this.discount;
	}

	public void setDiscount(short discount) {
		this.discount = discount;
	}

	public boolean getIsWritingExwarehouseVotes() {
		return this.isWritingExwarehouseVotes;
	}

	public void setIsWritingExwarehouseVotes(boolean isWritingExwarehouseVotes) {
		this.isWritingExwarehouseVotes = isWritingExwarehouseVotes;
	}

	public BigDecimal getPreTotalMoney() {
		return this.preTotalMoney;
	}

	public void setPreTotalMoney(BigDecimal preTotalMoney) {
		this.preTotalMoney = preTotalMoney;
	}

	public short getTax() {
		return this.tax;
	}

	public void setTax(short tax) {
		this.tax = tax;
	}

	public BigDecimal getTotalMoney() {
		return this.totalMoney;
	}

	public void setTotalMoney(BigDecimal totalMoney) {
		this.totalMoney = totalMoney;
	}

	public Timestamp getWritingDate() {
		return this.writingDate;
	}

	public void setWritingDate(Timestamp writingDate) {
		this.writingDate = writingDate;
	}

	public Order getOrder() {
		return this.order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}
	
	public LogForStock getLogForStock() {
		return this.logForStock;
	}

	public void setLogForStock(LogForStock logForStock) {
		this.logForStock = logForStock;
	}
	
}